package com.wuzhiming.istudy.service.impl;

import com.wuzhiming.istudy.pojo.Collection;
import com.wuzhiming.istudy.pojo.Comment;
import com.wuzhiming.istudy.service.BaseService;
import com.wuzhiming.istudy.service.CollectionService;
import com.wuzhiming.istudy.service.CommentService;
import org.springframework.stereotype.Service;

import java.util.List;

/**
 * @ClassName: commentServiceImpl
 * @Description:
 * @Author:zhimingw
 * @Version 1.0
 * @since 2022/3/16 19:58
 */
@Service("commentService")
public class CommentServiceImpl extends BaseService implements CommentService
{
    @Override
    public boolean addComment(Comment comment) {
        if(commentMapper.addComment(comment)==1){
            return true;
        }
        return false;
    }

    @Override
    public List<Comment> queryCommentById(Integer courseId) {
        return commentMapper.queryCommentById(courseId);
    }

    @Override
    public List<Comment> getUserComment(Comment comment) {
        return commentMapper.getUserComment(comment);
    }

    @Override
    public Integer getCount(Integer status) {
        return commentMapper.getCount(status);
    }

    @Override
    public List<Comment> queryAll() {
        return commentMapper.queryAll();
    }

    @Override
    public boolean update(Comment comment) {
        if(commentMapper.update(comment)==1){
            return true;
        }
        return false;
    }
}
